package com.pw.study.jdbc.config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @program: study_spring
 * @description: 配置文件读取
 * @author: future
 * @create: 2021-03-24 22:55
 **/
public class PropertiesUtil {
    public static void main(String[] args) {
        test();
    }

    private static void test() {
        Properties pro = new Properties();
        try {
            InputStream in =PropertiesUtil.class.getClassLoader().getResourceAsStream("jdbc.properties");
            pro.load(in);
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println(pro.getProperty("jdbc.username"));


    }

}
